<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>
<html:html>
<head>
	<title></title>
	
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/sampleForm.css" />
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/me.css" />	
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/help/help.css" />
	
	<script type='text/javascript' src='<%= request.getContextPath() %>/css/autocomplete/lib/jquery.js' ></script>  	 	

	
	<link type="text/css" href="<%= request.getContextPath() %>/css/datepicker/css/ui.all.css" rel="stylesheet" /> 	
	<script type="text/javascript" src="<%= request.getContextPath() %>/css/datepicker/lib/jquery-ui-1.5.3.min.js"></script>	
	
	<script type="text/javascript">
		$(document).ready(function(){									
    			$("#startDate_taxBuy").datepicker({ altField: 'input#startDate_taxBuy', altFormat: 'dd-mm-yy' });    			
    			$("#endDate_taxBuy").datepicker({ altField: 'input#endDate_taxBuy', altFormat: 'dd-mm-yy' });
    			
    			$("#startDate_materialsInStock").datepicker({ altField: 'input#startDate_materialsInStock', altFormat: 'dd-mm-yy' });
    			$("#endDate_materialsInStock").datepicker({ altField: 'input#endDate_materialsInStock', altFormat: 'dd-mm-yy' });
    			
    			$("#startDate_purchasingMaterials").datepicker({ altField: 'input#startDate_purchasingMaterials', altFormat: 'dd-mm-yy' });
    			$("#endDate_purchasingMaterials").datepicker({ altField: 'input#endDate_purchasingMaterials', altFormat: 'dd-mm-yy' });

    			$("#startDate_summary").datepicker({ altField: 'input#startDate_summary', altFormat: 'dd-mm-yy' });
    			$("#endDate_summary").datepicker({ altField: 'input#endDate_summary', altFormat: 'dd-mm-yy' });

    			
  		});
	</script>		
	<script type="text/javascript">
		function validate(startDate, endDate) {
			var valid = true;
			if(document.getElementById(startDate).value!="" ) {
				document.getElementById(startDate+"_error").innerHTML = "";
			}else {
				document.getElementById(startDate+"_error").innerHTML = "วันที่ไม่ถูกต้อง";
				valid = false;								
			}				 

			if(document.getElementById(endDate).value !="" ) {				
				document.getElementById(endDate+"_error").innerHTML = "";							
			}else {				
				document.getElementById(endDate+"_error").innerHTML = "วันที่ไม่ถูกต้อง";
				valid = false;				
			}				 			

			if(valid) {
			valid = check_startDate_endDate(startDate, endDate);
			}
			return valid;
		}

		function check_startDate_endDate(startDate, endDate) {
			var start_date = new Date(document.getElementById(startDate).value);
			var end_date = new Date(document.getElementById(endDate).value);

			if(start_date>end_date) {
				document.getElementById(startDate+"_error").innerHTML = "วันที่เริ่มต้น มากกว่า วันที่สิ้นสุด";
				document.getElementById(endDate+"_error").innerHTML = "";
				return false;
			}else {
				document.getElementById(startDate+"_error").innerHTML = "";
				document.getElementById(endDate+"_error").innerHTML = "";				
				return true;
			}
		}
		
	</script>
		
</head>
<body>
<div id="wrapper">
	 
	<div id="menu"><ul id="nav"></ul></div>

	<div id="content">
		<div id="menuNav"><a href='<%=request.getContextPath() %>/Login.do?mode=check'>หน้าหลัก</a> 
		>> รายงาน  >> รายงานแผนก Payroll</div><br />
		
		<div id="userPw01">
		<fieldset>
			<legend><b>รายงาน แยกกลุ่ม</b></legend>
			   <center>
	    		<html:form action="/payroll.do?mode=report&param=petty_cash_group"  target="_blank"  >
		    	<table border="1">
		    		<tr>
		    			<td align="right" >วันที่เริ่มต้น:</td>
		    			<td >
		    				<html:text property="startDate" styleId="startDate_materialsInStock" readonly="true" />
		    			</td>
		    			<td>ถึงวันที่:</td>
		    			<td>
		    				<html:text property="endDate" styleId="endDate_materialsInStock" readonly="true" />
		    			</td>
		    			<td rowspan="3"><html:submit value="ดูรายงาน" onclick="return validate('startDate_materialsInStock','endDate_materialsInStock');"  /></td>	    			
		    		</tr>
		    		<tr>
		    			<td ></td>
		    			<td><font color="red"><label id="startDate_materialsInStock_error"/></label></font> </td>
		    			<td ></td>
		    			<td><font color="red"><label id="endDate_materialsInStock_error"  /></label></font></td>
		    				    			
		    		</tr>		    		
		    		<tr>
		    			<td align="right">โรงงาน :</td>
		    			<td><html:select property="ttl" value="">
		    					<html:option value="CA1">TTL-1</html:option>
			                    <html:option value="CA2">TTL-2</html:option>
            			    </html:select>
            			</td>		    		
		    			<td align="right">กลุ่มรายงาน:</td>
		    			<td><html:select property="allocateCode" value="">	
		    					<html:option value="108">108 รับเงินเข้า Petty Cash-TTL1</html:option>	    					
		    					<html:option value="301">301 GASOLINE (HEAD OFFICE)</html:option>
			                    <html:option value="302">302 PAY FOOD SHOP</html:option>
			                    <html:option value="304">304 ICE EXP.</html:option>
			                    <html:option value="305">305 GARBAGE FEE</html:option>
			                    <html:option value="306">306 WELFARE</html:option>
			                    <html:option value="307">307 CAR RENT</html:option>
			                    <html:option value="308">308 GASOLINE</html:option>
			                    <html:option value="309">309 TAXI TOLL</html:option>
			                    <html:option value="310">310 PARK FEE</html:option>
			                    <html:option value="311">311 ALLOWANCE</html:option>
			                    <html:option value="312">312 TELEPHONE</html:option>
			                    <html:option value="313">313 EXP.CAR</html:option>
			                    <html:option value="314">314 EXP.FORK</html:option>
			                    <html:option value="315">315 TRAINNING</html:option>
			                    <html:option value="316">316 DORMITORY</html:option>
			                    <html:option value="317">317 WAGE FEE</html:option>
			                    <html:option value="318">318 NEWSPAPER</html:option>
			                    <html:option value="319">319 SPORT GAME</html:option>
			                    <html:option value="320">320 OTHER PAY</html:option>
			                    <html:option value="401">401 VAT</html:option>
			                    <html:option value="402">402 WITH HODING TAX</html:option>
			                    <html:option value="403">403 WITH TRAINNING</html:option>
			                    
		    				</html:select>
		    				<html:hidden property="billType" value="9-ซื้อทุกประเภท"></html:hidden>
		    				 
		    			</td>
		    		</tr>	    		   		    		
		    	</table>
	    		</html:form>
	    	</center>
	    </fieldset>
	    </div><!--
	    	    
		<div id="userPw01">
		<fieldset>
			<legend><b>รายงาน Purchasing Materials</b></legend>
			   <center>
	    		<html:form action="/payroll.do?mode=report&param=purchasingMaterials"  target="_blank"  >
		    	<table >
		    		<tr>
		    			<td align="right">วันที่เริ่มต้น:</td><td><html:text property="startDate" styleId="startDate_purchasingMaterials" readonly="true" /></td>
		    			<td align="right">ถึงวันที่:</td><td><html:text property="endDate" 	  styleId="endDate_purchasingMaterials" readonly="true" /></td>
		    			<td rowspan="3"><html:submit value="ดูรายงาน" onclick="return validate('startDate_purchasingMaterials','endDate_purchasingMaterials');" /></td>	    			
		    		</tr>
		    		<tr>
		    			<td ></td><td><font color="red"><label id="startDate_purchasingMaterials_error"/></label></font> </td>
		    			<td ></td><td><font color="red"><label id="endDate_purchasingMaterials_error"  /></label></font></td>
		    			<td ></td>	    			
		    		</tr>		    				    		
		    		<tr>
		    			
		    			<td align="right">รหัส/ชื่อ วัตถุดิบ:</td><td></td>
		    			<td align="right"></td><td></td>
		    		</tr>	    		   		    		
		    	</table>
	    		</html:form>
	    	</center>
	    </fieldset>
	    </div>	    

--><div id="userPw01">
		<fieldset>
			<legend><b>รายงาน สรุป</b></legend>
			   <center>
	    		<html:form action="/payroll.do?mode=report&param=petty_cash_summary"  target="_blank"  >
		    	<table border="1">
		    		<tr>
		    			<td align="right" >วันที่เริ่มต้น:</td>
		    			<td >
		    				<html:text property="startDate" styleId="startDate_summary" readonly="true" />
		    			</td>
		    			<td>ถึงวันที่:</td>
		    			<td>
		    				<html:text property="endDate" styleId="endDate_summary" readonly="true" />
		    			</td>
		    			<td rowspan="3"><html:submit value="ดูรายงาน" onclick="return validate('startDate_summary','endDate_summary');"  /></td>	    			
		    		</tr>
		    		<tr>
		    			<td ></td>
		    			<td><font color="red"><label id="startDate_summary_error"/></label></font> </td>
		    			<td ></td>
		    			<td><font color="red"><label id="endDate_summary_error"  /></label></font></td>
		    				    			
		    		</tr>		    		
		    		<tr>
		    			<td align="right">โรงงาน :</td>
		    			<td><html:select property="ttl" value="">
		    					<html:option value="CA1">TTL-1</html:option>
			                    <html:option value="CA2">TTL-2</html:option>
            			    </html:select>
            			</td>		    		
		    			<td align="right">ยอดเงินคงเหลือใหม่:</td>
		    			<td>
		    				 
		    			</td>
		    		</tr>	    		   		    		
		    	</table>
	    		</html:form>
	    	</center>
	    </fieldset>
	    </div>		
	    	    
    </div>
</div>
</body>
</html:html>
